package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import com.tanhua.model.mongo.Video;
import com.tanhua.model.mongo.Voice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor//桃花传音，返回前端的vo对象
public class VoiceVo implements Serializable {


    //用户详情
    private Long Id; //用户id
    private String avatar; //头像
    private String nickname; //昵称
    private String gender; //性别 man woman
    private Integer age; //年龄

    private String soundUrl; //语音URL
    private Integer remainingTimes;//语音的剩余次数

    //构造方法
   public static VoiceVo init(UserInfo userInfo, Voice voice) {
       VoiceVo vo = new VoiceVo();
        //copy用户属性
        BeanUtils.copyProperties(userInfo,vo);  //
        //copy视频属性
        BeanUtils.copyProperties(voice,vo);
        return vo;
    }


}
